library(ggplot2)

showdata <- function(X, ylim1, ylim2)
{
	par(mar=c(2.8,2,0.4,0), oma=c(0,0,0,0))
	ts <- as.numeric(X)
	ts <- diff(ts)/(ts[-length(ts)])
	# we remove outlier here ts<30 ..
	
	df <- data.frame(time = time(X)[-length(X)], r=ts, color=ts>0)
	
	ggplot(df) + geom_line(aes(x=time, y=r, color=color)) +
		theme(legend.position='none', axis.title.y=element_blank(), axis.title.x=element_blank()) +
		ylim(ylim1,ylim2)
}

